//引入vue模块
import vue from "vue";
//下载路由,引进来
import vueRouter from "vue-router";
//使用路由
vue.use(vueRouter);

import index from "../components/index.vue";
import home from "../components/home.vue";
import knowledgeFile from "../components/knowledgeFile.vue";
import workProgress from "../components/workProgress.vue";
import deviceManage from "../components/deviceManage.vue";
import addInfo from "../components/addInfo.vue";
import message from "../components/message.vue";
import modifyPassword from "../components/modifyPassword.vue";
import login from "../components/login.vue";
import deviceDetail from "../components/deviceDetail.vue";



const route =[
    {
        path:"",
        component:home,
        name:"home",
        redirect:"/home",
        children:[
            {path:"",redirect:"index" },
            {path:"index",component:index},
            {path:"workProgress",component:workProgress},
            {path:"knowledgeFile",component:knowledgeFile},
            {path:"deviceManage",component:deviceManage}
        ]
    },
    {
        path:"/addInfo",
        component:addInfo,
        name:"addInfo"
    },
    {
        path:"/message",
        component:message,
        name:"message"
    },
    {
        path:"/modifyPassword",
        component:modifyPassword,
        name:"modifyPassword"
    },
    {
        path:"/login",
        component:login,
        name:"login"
    },
    {
        path:'/deviceDetail',
        component:deviceDetail,
        name:'deviceDetail'
    }
   
]
//创建路由实例
const router = new vueRouter({
    routes:route
})
//输出router实例
export default router;